using System;
using NUnit.Framework;
using XcoAppSpaces.Core.Ports;

namespace test.XcoAppSpaces.Core
{
	[TestFixture]
	public class testErrorReproduction
	{
		[Test]
		[ExpectedException]
		public void Receive_with_timeout_throws_exception()
		{
			//reproduction of error that no receive timeout is thrown - seems to be a problem with using "await" (current ports version doesn't use it anymore)
			var port = new Port<string> ();
			Console.WriteLine ("starting to wait for task");
			var result = port.Receive (1000).Result;
			Console.WriteLine ("finished waiting for task!");
		}
	}
}

